<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<title>PlanarGC: Planar.h Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
</script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { searchBox.OnSelectItem(0); });
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td style="padding-left: 0.5em;">
   <div id="projectname">PlanarGC
   &#160;<span id="projectnumber">1.0.2</span>
   </div>
  </td>
   <td>        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
</td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.1.2 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('a00041_source.html','');});
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Data Structures</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Enumerator</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Friends</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(7)"><span class="SelectionMark">&#160;</span>Pages</a></div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="headertitle">
<div class="title">Planar.h</div>  </div>
</div><!--header-->
<div class="contents">
<div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span>&#160;<span class="comment">/*****************************************************************************</span></div>
<div class="line"><a name="l00002"></a><span class="lineno">    2</span>&#160;<span class="comment">*    PlanarCut - software to compute MinCut / MaxFlow in a planar graph      *</span></div>
<div class="line"><a name="l00003"></a><span class="lineno">    3</span>&#160;<span class="comment">*                                Version 1.0                                 *</span></div>
<div class="line"><a name="l00004"></a><span class="lineno">    4</span>&#160;<span class="comment">*                                                                            *</span></div>
<div class="line"><a name="l00005"></a><span class="lineno">    5</span>&#160;<span class="comment">*    Copyright 2011 Eno Töppe &lt;toeppe@in.tum.de&gt;                             *</span></div>
<div class="line"><a name="l00006"></a><span class="lineno">    6</span>&#160;<span class="comment">*                   Frank R. Schmidt &lt;fschmidt@uwo.ca&gt;                       *</span></div>
<div class="line"><a name="l00007"></a><span class="lineno">    7</span>&#160;<span class="comment">******************************************************************************</span></div>
<div class="line"><a name="l00008"></a><span class="lineno">    8</span>&#160;<span class="comment"></span></div>
<div class="line"><a name="l00009"></a><span class="lineno">    9</span>&#160;<span class="comment">  If you use this software for research purposes, YOU MUST CITE the following </span></div>
<div class="line"><a name="l00010"></a><span class="lineno">   10</span>&#160;<span class="comment">  paper in any resulting publication:</span></div>
<div class="line"><a name="l00011"></a><span class="lineno">   11</span>&#160;<span class="comment"></span></div>
<div class="line"><a name="l00012"></a><span class="lineno">   12</span>&#160;<span class="comment">    [1] Efficient Planar Graph Cuts with Applications in Computer Vision.</span></div>
<div class="line"><a name="l00013"></a><span class="lineno">   13</span>&#160;<span class="comment">        F. R. Schmidt, E. Töppe, D. Cremers, </span></div>
<div class="line"><a name="l00014"></a><span class="lineno">   14</span>&#160;<span class="comment">            IEEE CVPR, Miami, Florida, June 2009                </span></div>
<div class="line"><a name="l00015"></a><span class="lineno">   15</span>&#160;<span class="comment"></span></div>
<div class="line"><a name="l00016"></a><span class="lineno">   16</span>&#160;<span class="comment">******************************************************************************</span></div>
<div class="line"><a name="l00017"></a><span class="lineno">   17</span>&#160;<span class="comment"></span></div>
<div class="line"><a name="l00018"></a><span class="lineno">   18</span>&#160;<span class="comment">  This software is released under the LGPL license. Details are explained</span></div>
<div class="line"><a name="l00019"></a><span class="lineno">   19</span>&#160;<span class="comment">  in the files &#39;COPYING&#39; and &#39;COPYING.LESSER&#39;.</span></div>
<div class="line"><a name="l00020"></a><span class="lineno">   20</span>&#160;<span class="comment">        </span></div>
<div class="line"><a name="l00021"></a><span class="lineno">   21</span>&#160;<span class="comment">*****************************************************************************/</span></div>
<div class="line"><a name="l00022"></a><span class="lineno">   22</span>&#160;</div>
<div class="line"><a name="l00023"></a><span class="lineno">   23</span>&#160;<span class="preprocessor">#ifndef __PLANAR_H</span></div>
<div class="line"><a name="l00024"></a><span class="lineno">   24</span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define __PLANAR_H</span></div>
<div class="line"><a name="l00025"></a><span class="lineno">   25</span>&#160;<span class="preprocessor"></span></div>
<div class="line"><a name="l00026"></a><span class="lineno">   26</span>&#160;<span class="preprocessor">#include &quot;CutPlanarDefs.h&quot;</span></div>
<div class="line"><a name="l00027"></a><span class="lineno">   27</span>&#160;</div>
<div class="line"><a name="l00028"></a><span class="lineno">   28</span>&#160;</div>
<div class="line"><a name="l00029"></a><span class="lineno">   29</span>&#160;<span class="keyword">class </span><a class="code" href="a00027.html">PlanarVertex</a>; <span class="comment">//forward declaration</span></div>
<div class="line"><a name="l00030"></a><span class="lineno">   30</span>&#160;<span class="keyword">class </span><a class="code" href="a00025.html">PlanarEdge</a>; <span class="comment">//forward declaration</span></div>
<div class="line"><a name="l00031"></a><span class="lineno"><a class="code" href="a00026.html">   31</a></span>&#160;<span class="keyword">class </span><a class="code" href="a00026.html">PlanarFace</a> </div>
<div class="line"><a name="l00037"></a><span class="lineno">   37</span>&#160;{};</div>
<div class="line"><a name="l00038"></a><span class="lineno">   38</span>&#160;</div>
<div class="line"><a name="l00039"></a><span class="lineno"><a class="code" href="a00025.html">   39</a></span>&#160;<span class="keyword">class </span><a class="code" href="a00025.html">PlanarEdge</a> </div>
<div class="line"><a name="l00052"></a><span class="lineno">   52</span>&#160;{</div>
<div class="line"><a name="l00053"></a><span class="lineno"><a class="code" href="a00025.html#ae691dd582ea147101f33e641aa953de4">   53</a></span>&#160;    <span class="keyword">friend</span> <span class="keyword">class </span><a class="code" href="a00027.html">PlanarVertex</a>; <span class="comment">//for efficiency vertex and edge are closely connected</span></div>
<div class="line"><a name="l00054"></a><span class="lineno">   54</span>&#160;</div>
<div class="line"><a name="l00055"></a><span class="lineno">   55</span>&#160;    CapType cap;  <span class="comment">//forward edge capacity </span></div>
<div class="line"><a name="l00056"></a><span class="lineno">   56</span>&#160;    CapType rcap; <span class="comment">//backward edge capacity</span></div>
<div class="line"><a name="l00057"></a><span class="lineno">   57</span>&#160;</div>
<div class="line"><a name="l00058"></a><span class="lineno">   58</span>&#160;    <a class="code" href="a00027.html">PlanarVertex</a> *tail;     <span class="comment">//an edge points from the tail vertex</span></div>
<div class="line"><a name="l00059"></a><span class="lineno">   59</span>&#160;    <a class="code" href="a00027.html">PlanarVertex</a> *head;     <span class="comment">//to the head vertex.</span></div>
<div class="line"><a name="l00060"></a><span class="lineno">   60</span>&#160;</div>
<div class="line"><a name="l00061"></a><span class="lineno">   61</span>&#160;    <a class="code" href="a00026.html">PlanarFace</a>   *tailDual; <span class="comment">//the face left of the edge wrt. the pointing direction</span></div>
<div class="line"><a name="l00062"></a><span class="lineno">   62</span>&#160;    <a class="code" href="a00026.html">PlanarFace</a>   *headDual; <span class="comment">//the face right of the edge wrt. the pointing direction</span></div>
<div class="line"><a name="l00063"></a><span class="lineno">   63</span>&#160;</div>
<div class="line"><a name="l00064"></a><span class="lineno">   64</span>&#160;    <span class="comment">//these are for fast access to edge IDs</span></div>
<div class="line"><a name="l00065"></a><span class="lineno">   65</span>&#160;    <span class="keywordtype">int</span> tailEdgeID; <span class="comment">//the ID of this edge with respect to the tail vertex</span></div>
<div class="line"><a name="l00066"></a><span class="lineno">   66</span>&#160;    <span class="keywordtype">int</span> headEdgeID; <span class="comment">//the ID of this edge with respect to the head vertex</span></div>
<div class="line"><a name="l00067"></a><span class="lineno">   67</span>&#160;</div>
<div class="line"><a name="l00068"></a><span class="lineno">   68</span>&#160;    uchar  flags; <span class="comment">//a maximum of 8 flags that can be used freely</span></div>
<div class="line"><a name="l00069"></a><span class="lineno">   69</span>&#160;</div>
<div class="line"><a name="l00070"></a><span class="lineno">   70</span>&#160;    </div>
<div class="line"><a name="l00071"></a><span class="lineno">   71</span>&#160;<span class="keyword">public</span>:</div>
<div class="line"><a name="l00072"></a><span class="lineno">   72</span>&#160;</div>
<div class="line"><a name="l00076"></a><span class="lineno">   76</span>&#160;    <a class="code" href="a00025.html#a58ee3abf4c78082186dd0a6f486a763b">PlanarEdge</a>();</div>
<div class="line"><a name="l00078"></a><span class="lineno"><a class="code" href="a00025.html#a57ea16f3e1ee1b896a6429ab070851f9">   78</a></span>&#160;    CapType <a class="code" href="a00025.html#a57ea16f3e1ee1b896a6429ab070851f9">getCapacity</a>() { <span class="keywordflow">return</span> cap; }</div>
<div class="line"><a name="l00080"></a><span class="lineno"><a class="code" href="a00025.html#ad8e5b373fac163e65dd7c336d0537c58">   80</a></span>&#160;    CapType <a class="code" href="a00025.html#ad8e5b373fac163e65dd7c336d0537c58">getRevCapacity</a>() { <span class="keywordflow">return</span> rcap; }</div>
<div class="line"><a name="l00081"></a><span class="lineno">   81</span>&#160;</div>
<div class="line"><a name="l00084"></a><span class="lineno"><a class="code" href="a00025.html#a9efe6cae1df6651ca86b9d0ad1ef0d88">   84</a></span>&#160;    <span class="keywordtype">void</span>   <a class="code" href="a00025.html#a9efe6cae1df6651ca86b9d0ad1ef0d88">setCapacity</a>(CapType cap) { this-&gt;cap = cap; }</div>
<div class="line"><a name="l00087"></a><span class="lineno"><a class="code" href="a00025.html#a0e70931a3878cbf26a4059894dcb8455">   87</a></span>&#160;    <span class="keywordtype">void</span>   <a class="code" href="a00025.html#a0e70931a3878cbf26a4059894dcb8455">setRevCapacity</a>(CapType rcap) { this-&gt;rcap = rcap; }</div>
<div class="line"><a name="l00088"></a><span class="lineno">   88</span>&#160;</div>
<div class="line"><a name="l00092"></a><span class="lineno">   92</span>&#160;    <span class="keywordtype">void</span>   <a class="code" href="a00025.html#a5925dae5531f32dce166b70d510b68ad">setEdge</a>(<a class="code" href="a00027.html">PlanarVertex</a> *tail,     <a class="code" href="a00027.html">PlanarVertex</a> *head,     </div>
<div class="line"><a name="l00093"></a><span class="lineno">   93</span>&#160;                   <a class="code" href="a00026.html">PlanarFace</a>   *tailDual, <a class="code" href="a00026.html">PlanarFace</a>   *headDual, </div>
<div class="line"><a name="l00094"></a><span class="lineno">   94</span>&#160;                   CapType cap=1.0, CapType rcap=0.0);</div>
<div class="line"><a name="l00095"></a><span class="lineno">   95</span>&#160;</div>
<div class="line"><a name="l00097"></a><span class="lineno"><a class="code" href="a00025.html#af542602ac3e6fd862378540aac401566">   97</a></span>&#160;    <span class="keywordtype">void</span>  <a class="code" href="a00025.html#af542602ac3e6fd862378540aac401566">setFlags</a>(uchar value) { flags = value; } </div>
<div class="line"><a name="l00099"></a><span class="lineno"><a class="code" href="a00025.html#a5d65ae2b6827da09a810e69e41928e7d">   99</a></span>&#160;    uchar <a class="code" href="a00025.html#a5d65ae2b6827da09a810e69e41928e7d">getFlags</a>() { <span class="keywordflow">return</span> flags; }</div>
<div class="line"><a name="l00100"></a><span class="lineno">  100</span>&#160;  </div>
<div class="line"><a name="l00102"></a><span class="lineno"><a class="code" href="a00025.html#a985bd04c284fd2527cfd8841b3cae49a">  102</a></span>&#160;    <a class="code" href="a00027.html">PlanarVertex</a> *<a class="code" href="a00025.html#a985bd04c284fd2527cfd8841b3cae49a">getHead</a>() { <span class="keywordflow">return</span> head; }</div>
<div class="line"><a name="l00104"></a><span class="lineno"><a class="code" href="a00025.html#a3590b0fe6674ff0828705ad52f40908d">  104</a></span>&#160;    <a class="code" href="a00027.html">PlanarVertex</a> *<a class="code" href="a00025.html#a3590b0fe6674ff0828705ad52f40908d">getTail</a>() { <span class="keywordflow">return</span> tail; }</div>
<div class="line"><a name="l00106"></a><span class="lineno"><a class="code" href="a00025.html#a4056d9b002ec9db739e8f608e0c0c01b">  106</a></span>&#160;    <a class="code" href="a00026.html">PlanarFace</a>   *<a class="code" href="a00025.html#a4056d9b002ec9db739e8f608e0c0c01b">getHeadDual</a>() { <span class="keywordflow">return</span> headDual; }</div>
<div class="line"><a name="l00108"></a><span class="lineno"><a class="code" href="a00025.html#a2c49a53683819fcfbccda2e3cb9b04e1">  108</a></span>&#160;    <a class="code" href="a00026.html">PlanarFace</a>   *<a class="code" href="a00025.html#a2c49a53683819fcfbccda2e3cb9b04e1">getTailDual</a>() { <span class="keywordflow">return</span> tailDual; }</div>
<div class="line"><a name="l00109"></a><span class="lineno">  109</span>&#160;  </div>
<div class="line"><a name="l00110"></a><span class="lineno">  110</span>&#160;};</div>
<div class="line"><a name="l00111"></a><span class="lineno">  111</span>&#160;</div>
<div class="line"><a name="l00112"></a><span class="lineno"><a class="code" href="a00027.html">  112</a></span>&#160;<span class="keyword">class </span><a class="code" href="a00027.html">PlanarVertex</a> </div>
<div class="line"><a name="l00128"></a><span class="lineno">  128</span>&#160;{</div>
<div class="line"><a name="l00129"></a><span class="lineno"><a class="code" href="a00027.html#a633fc000a7f785eefc4172715e3ff7c1">  129</a></span>&#160;  <span class="keyword">friend</span> <span class="keyword">class </span><a class="code" href="a00025.html">PlanarEdge</a>; <span class="comment">//for efficiency vertex and edge are closely connected</span></div>
<div class="line"><a name="l00130"></a><span class="lineno">  130</span>&#160;</div>
<div class="line"><a name="l00131"></a><span class="lineno">  131</span>&#160;  <span class="keywordtype">int</span> nEdges;             <span class="comment">//number of adjacent edges</span></div>
<div class="line"><a name="l00132"></a><span class="lineno">  132</span>&#160;  <a class="code" href="a00025.html">PlanarEdge</a> **edgesCCW;  <span class="comment">//ccw list of adjacent edges</span></div>
<div class="line"><a name="l00133"></a><span class="lineno">  133</span>&#160;</div>
<div class="line"><a name="l00134"></a><span class="lineno">  134</span>&#160; <span class="keyword">public</span>:</div>
<div class="line"><a name="l00136"></a><span class="lineno">  136</span>&#160;  <a class="code" href="a00027.html#aeff0261a041fd159e3c1c16094d61ca0">PlanarVertex</a>();</div>
<div class="line"><a name="l00138"></a><span class="lineno">  138</span>&#160;  <a class="code" href="a00027.html#adc8b56d8ff53b0875d177a252367b6ae">~PlanarVertex</a>();</div>
<div class="line"><a name="l00139"></a><span class="lineno">  139</span>&#160;  </div>
<div class="line"><a name="l00141"></a><span class="lineno"><a class="code" href="a00027.html#a33477752176de2324e782acad7d65d2b">  141</a></span>&#160;  <span class="keywordtype">int</span>         <a class="code" href="a00027.html#a33477752176de2324e782acad7d65d2b">getNumEdges</a>() { <span class="keywordflow">return</span> nEdges; };</div>
<div class="line"><a name="l00154"></a><span class="lineno"><a class="code" href="a00027.html#a59deac4a342fff7e0dda28aa83937909">  154</a></span>&#160;  <a class="code" href="a00025.html">PlanarEdge</a> *<a class="code" href="a00027.html#a59deac4a342fff7e0dda28aa83937909">getEdge</a>(<span class="keywordtype">int</span> <span class="keywordtype">id</span>) { <span class="keywordtype">id</span>=<span class="keywordtype">id</span>%nEdges; <span class="keywordflow">return</span> (<span class="keywordtype">id</span>&lt;0)?edgesCCW[<span class="keywordtype">id</span>+nEdges]:edgesCCW[id]; };</div>
<div class="line"><a name="l00159"></a><span class="lineno">  159</span>&#160;  <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="a00027.html#a96f79bc032b6354c1c436eee2e72256b">setEdgesCCW</a>(<a class="code" href="a00025.html">PlanarEdge</a> **ccw, <span class="keywordtype">int</span> nEdges);</div>
<div class="line"><a name="l00163"></a><span class="lineno">  163</span>&#160;  <span class="keyword">inline</span> <span class="keywordtype">int</span>  <a class="code" href="a00027.html#aa32cd7f948bf71d7d8fba1f2d374d087">getEdgeID</a>(<a class="code" href="a00025.html">PlanarEdge</a> *e);</div>
<div class="line"><a name="l00164"></a><span class="lineno">  164</span>&#160;};</div>
<div class="line"><a name="l00165"></a><span class="lineno">  165</span>&#160;</div>
<div class="line"><a name="l00166"></a><span class="lineno">  166</span>&#160;</div>
<div class="line"><a name="l00167"></a><span class="lineno">  167</span>&#160;<span class="comment">/***************************************************</span></div>
<div class="line"><a name="l00168"></a><span class="lineno">  168</span>&#160;<span class="comment"> *** PlanarVertex INLINE ***************************</span></div>
<div class="line"><a name="l00169"></a><span class="lineno">  169</span>&#160;<span class="comment"> ***************************************************/</span></div>
<div class="line"><a name="l00170"></a><span class="lineno"><a class="code" href="a00027.html#a96f79bc032b6354c1c436eee2e72256b">  170</a></span>&#160;<span class="keywordtype">void</span> <a class="code" href="a00027.html#a96f79bc032b6354c1c436eee2e72256b">PlanarVertex::setEdgesCCW</a>(<a class="code" href="a00025.html">PlanarEdge</a> **ccw, <span class="keywordtype">int</span> nEdges) {</div>
<div class="line"><a name="l00171"></a><span class="lineno">  171</span>&#160;</div>
<div class="line"><a name="l00172"></a><span class="lineno">  172</span>&#160;  <span class="keywordflow">if</span> (nEdges != this-&gt;nEdges) {</div>
<div class="line"><a name="l00173"></a><span class="lineno">  173</span>&#160;    <span class="keywordflow">if</span> (this-&gt;nEdges)</div>
<div class="line"><a name="l00174"></a><span class="lineno">  174</span>&#160;      <span class="keyword">delete</span> [] edgesCCW;</div>
<div class="line"><a name="l00175"></a><span class="lineno">  175</span>&#160;    <span class="keywordflow">if</span> (nEdges)</div>
<div class="line"><a name="l00176"></a><span class="lineno">  176</span>&#160;      edgesCCW = <span class="keyword">new</span> <a class="code" href="a00025.html">PlanarEdge</a>*[nEdges];</div>
<div class="line"><a name="l00177"></a><span class="lineno">  177</span>&#160;    this-&gt;nEdges = nEdges;</div>
<div class="line"><a name="l00178"></a><span class="lineno">  178</span>&#160;  }</div>
<div class="line"><a name="l00179"></a><span class="lineno">  179</span>&#160;  <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i=0; i&lt;nEdges; i++) {</div>
<div class="line"><a name="l00180"></a><span class="lineno">  180</span>&#160;    edgesCCW[i] = ccw[i];</div>
<div class="line"><a name="l00181"></a><span class="lineno">  181</span>&#160;    <span class="keywordflow">if</span> (edgesCCW[i]-&gt;<a class="code" href="a00025.html#a3590b0fe6674ff0828705ad52f40908d">getTail</a>() == <span class="keyword">this</span>)</div>
<div class="line"><a name="l00182"></a><span class="lineno">  182</span>&#160;      edgesCCW[i]-&gt;tailEdgeID = i;</div>
<div class="line"><a name="l00183"></a><span class="lineno">  183</span>&#160;    <span class="keywordflow">else</span> <span class="keywordflow">if</span> (edgesCCW[i]-&gt;<a class="code" href="a00025.html#a985bd04c284fd2527cfd8841b3cae49a">getHead</a>() == <span class="keyword">this</span>)</div>
<div class="line"><a name="l00184"></a><span class="lineno">  184</span>&#160;      edgesCCW[i]-&gt;headEdgeID = i;</div>
<div class="line"><a name="l00185"></a><span class="lineno">  185</span>&#160;  }</div>
<div class="line"><a name="l00186"></a><span class="lineno">  186</span>&#160;</div>
<div class="line"><a name="l00187"></a><span class="lineno">  187</span>&#160;}</div>
<div class="line"><a name="l00188"></a><span class="lineno">  188</span>&#160;</div>
<div class="line"><a name="l00189"></a><span class="lineno">  189</span>&#160;</div>
<div class="line"><a name="l00190"></a><span class="lineno"><a class="code" href="a00027.html#aa32cd7f948bf71d7d8fba1f2d374d087">  190</a></span>&#160;<span class="keywordtype">int</span> <a class="code" href="a00027.html#aa32cd7f948bf71d7d8fba1f2d374d087">PlanarVertex::getEdgeID</a>(<a class="code" href="a00025.html">PlanarEdge</a> *e) {</div>
<div class="line"><a name="l00191"></a><span class="lineno">  191</span>&#160;  <span class="comment">//for efficiency edge IDs are stored in the edges themselves</span></div>
<div class="line"><a name="l00192"></a><span class="lineno">  192</span>&#160;  <span class="keywordflow">if</span> (e-&gt;<a class="code" href="a00025.html#a3590b0fe6674ff0828705ad52f40908d">getTail</a>() == <span class="keyword">this</span>)</div>
<div class="line"><a name="l00193"></a><span class="lineno">  193</span>&#160;    <span class="keywordflow">return</span> e-&gt;tailEdgeID;</div>
<div class="line"><a name="l00194"></a><span class="lineno">  194</span>&#160;  <span class="keywordflow">else</span> if (e-&gt;<a class="code" href="a00025.html#a985bd04c284fd2527cfd8841b3cae49a">getHead</a>() == <span class="keyword">this</span>)</div>
<div class="line"><a name="l00195"></a><span class="lineno">  195</span>&#160;    <span class="keywordflow">return</span> e-&gt;headEdgeID;</div>
<div class="line"><a name="l00196"></a><span class="lineno">  196</span>&#160;  <span class="keywordflow">else</span></div>
<div class="line"><a name="l00197"></a><span class="lineno">  197</span>&#160;    <span class="keywordflow">return</span> -1;</div>
<div class="line"><a name="l00198"></a><span class="lineno">  198</span>&#160;}</div>
<div class="line"><a name="l00199"></a><span class="lineno">  199</span>&#160;</div>
<div class="line"><a name="l00200"></a><span class="lineno">  200</span>&#160;<span class="preprocessor">#endif</span></div>
</div><!-- fragment --></div><!-- contents -->
</div><!-- doc-content -->
<hr class="footer"/><address style="text-align: right;"><small>
  &copy; 2009 - 2013 by Eno T&ouml;ppe, Frank R. Schmidt
  <br/>
  generated by <a href="http://www.doxygen.org/index.html" target="_blank">Doxygen</a>
</small></address>
